//游记详情页面
import request from '../request/request';


//  获取游记详情数据
export const fetchStrategyDetails = (intrId) => {
  return request({
    url: '/Traexp/index',
    method: 'post',
    data: { intr_id: intrId },
  });
};


//  添加/取消收藏
export const toggleCollection = (userId, type, contentId) => {
  return request({
    url: '/Collect/add',
    method: 'post',
    data: { 
      user_id: userId,
      type,
      intro_id: contentId
    },
  });
};

//添加评论

export const addComment = (userId, scenicId, content, score) => {
  return request({
    url: '/Comment/add',
    method: 'post',
    data: {
      user_id: userId,
      scenic_id: scenicId,
      content,
      score
    },
  });
};

// 获取游记评论

export const getTravelComments = (travelId) => {
  return request({
    url: '/Comment/index',
    method: 'post',
    data: { travel_id: travelId },
  });
};